package cn.wolfcode.mapper;

import cn.wolfcode.domain.Role;
import cn.wolfcode.qo.QueryObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RoleMapper {

    int insert(Role role);

    int deleteByPrimaryKey(Long id);

    int updateByPrimaryKey(Role role);

    Role selectByPrimaryKey(Long id);

    List<Role> selectAll();

    List<Role> selectForList(QueryObject qo);

    void deleteRelation(Long roleId);

    void insertRelation(@Param("roleId") Long roleId, @Param("permissionId") Long permissionId);

    List<Role> selectByEmployeeId(Long employeeId);
}